package com.open.demo.协程

import android.util.Log
import com.open.demo.utils.Constats
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

/**
 */
class 协程Demo {
}

fun main() {
    GlobalScope.launch(Dispatchers.Main) {
        val result = getUserSusped("hailong.qiu")
        Log.d(Constats.TAG, "getUserSusped result:$result")
    }
}

suspend fun getUserSusped(name:String):String {
    Thread.sleep(1888)
    return "获取 姓名:$name"
}